import java.io.*;
import java.util.HashSet;
import java.util.Set;
import java.util.Vector;

public class Preferences implements Serializable {
	private Vector<String> cost;
	private Vector<String> meal;
	private Vector<String> type;
	private Vector<String> mood;
	
	public Preferences() {
		cost = new Vector<String>();
		meal = new Vector<String>();
		type = new Vector<String>();
		mood = new Vector<String>();
	}

	public void addCost(String cost) {
		this.cost.add(cost);
	}
	
	public void addMeal(String meal) {
		this.meal.add(meal);
	}
	
	public void addType(String type) {
		this.type.add(type);
	}
	
	public void addMood(String mood) {
		this.mood.add(mood);
	}
	
	public Vector<String> getCost() {
		return cost;
	}
	
	public Vector<String> getMeal() {
		return meal;
	}
	
	public Vector<String> getType() {
		return type;
	}
	
	public Vector<String> getMood() {
		return mood;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		return true;
	}
	
	// pref is contained by this
	public boolean contains(Preferences pref) {
		/*
		for( String c: pref.cost ) {
			if( this.cost.contains(c) )
				return false;
		}
		for( String m: pref.meal ) {
			if( this.meal.contains(m) )
				return false;
		}
		for( String t: pref.type ) {
			if( this.type.contains(t) )
				return false;
		}
		for( String m: pref.mood ) {
			if( this.mood.contains(m) )
				return false;
		}
		*/
		if( !this.cost.containsAll(pref.cost))
			return false;
		if( !this.meal.containsAll(pref.meal))
			return false;
		if( !this.type.containsAll(pref.type))
			return false;
		if( !this.mood.containsAll(pref.mood))
			return false;
		return true;
	}
}
